﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>分监区-呈报-会议流程</title>

    <link href="/WF/Scripts/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/WF/Style/skin/adminfont/iconfont.css" rel="stylesheet" />
    <link href="/WF/Style/skin/css/Default.css" rel="stylesheet" />

    <!--通用js-->
    <script src="/WF/Scripts/jquery-1.11.0.min.js" type="text/javascript"></script>
    <script src="/WF/Scripts/QueryString.js" type="text/javascript"></script>
    <script src="/WF/Scripts/config.js" type="text/javascript"></script>
    <script src="/WF/Comm/Gener.js" type="text/javascript"></script>
    <link href="/WF/css/icons.css" rel="stylesheet" />
    <style type="text/css">
    </style>
    <script type="text/javascript">

        var workID = GetQueryString("WorkID"); //workid 子线程的ID
        var fid = GetQueryString("FID"); //fid.
        $(function () {

            var webUser = new WebUser();

            //获得监狱编号。截取前4位.
            var jianYuNo = webUser.FK_Dept.slice(0, 5);

            //查询出来停留在 113：刑罚科-会议进度监控， 加上用户所在的监狱编号才可以.
            var ens = new Entities("BP.WF.GenerWorkFlows");
            ens.Retrieve("FK_Node", 113); //停留节点.

            var html = "<table class='table table-bordered table - hover' >";
            html += "<caption>您好：" + webUser.No + "-" + webUser.Name + "，来自:" + webUser.FK_DeptName + ", 合计有:" + ens.length + "个批次的数据。</caption>";
            html += "<tr>";
            html += "<th>#</th>";
            html += "<th>标题</th>";
            html += "<th>日期</th>";
            html += "<th>发送日期</th>";
            html += "<th>批次号</th>";
            html += "<th>呈报流程信息</th>";
            //  html += "<th>操作</th>";
            html += "</tr>";

            //遍历停留在改节点上的流程.
            for (var i = 0; i < ens.length; i++) {
                var en = ens[i];

                html += "<tr>";
                html += "<td># </td>";
                html += "<td>" + en.Title + "</td>";
                html += "<td>" + en.RDT + "</td>";
                html += "<td>" + en.SendDT + "</td>";
                html += "<td>" + en.BillNo + "</td>";
                var msg = "";
                var ens003 = new Entities("BP.WF.GenerWorkFlows");
                ens003.Retrieve("PWorkID", en.WorkID);
                if (ens003.length == 0) {
                    msg += "<a href=\"javascript:StartFlow003_Send('" + en.WorkID + "')\" >启动：分监区-呈报-会议流程 </a>";
                }
                else {
                    for (var myidx = 0; myidx < ens003.length; myidx++) {

                        var gwf = ens003[myidx];
                        msg += "标题：" + gwf.Title + "<hr/>";
                        msg += "节点：" + gwf.NodeName + "<br/>";
                        msg += "处理人：" + gwf.TodoEmps + "<br/>";
                        msg += "发送日期：" + gwf.SendDT + "<br/>";

                    }
                }
                html += "<td>" + msg + "</td>";
                html += "</tr>";

                



            }
            html += "</table>";
            $("#docs").html(html);

        });

        //启动子流程.
        function StartFlow003_Send(pworkid) {

            var handler = new HttpHandler("BP.JianYu.AppHandler");
            handler.AddPara("PWorkID", pworkid);
            var data = handler.DoMethodReturnString("StartFlow003_Send");
            window.location.href = "/WF/MyFlow.htm?WorkID=" + data + "&FK_Flow=003";
        }

        //执行发送到下一步.
        function SendIt() {
            if (window.confirm('确定要发送吗？') == false)
                return;
            //  $("#toolbar").hid();
            $("#toolbar").html("正在发送请稍后.");

            var handler = new HttpHandler("BP.JianYu.AppHandler");
            handler.AddUrlData();
            var data = handler.DoMethodReturnString("ND102_SendIt");
            $("#toolbar").html("发送成功...");
            $("#docs").html(data);
        }
        function Chart() {
            var url = "/WF/WorkOpt/OneWork/Chart.htm?WorkID=" + GetQueryString("WorkID") + "&FK_Node=" + GetQueryString("FK_Node");
            url += "&FID=" + GetQueryString("FID") + "&FK_Flow=001";
            WinOpen(url);
        }
    </script>
</head>
<body>

    <h3>
        分监区-呈报-会议流程
    </h3>

    <div id="docs">  </div>

</body>
</html>
